<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <meta http-equiv="x-ua-compatible" content="IE=edge">
    <link rel="stylesheet" href="../../vendor/bootstrap3/css/bootstrap.min.css">
</head>
<body ng-app="myApp">
<div class="container">
    <form name="myForm" class="form-group">
        <label>
            Enter your name:
            <input type="text"
                   name="myName"
                   ng-model="name"
                   ng-minlength="5"
                   ng-maxlength="20"
                   required />
        </label>
        <pre>myForm.myName.$error = {{ myForm.myName.$error | json }}</pre>

        <div ng-messages="myForm.myName.$error" style="color:maroon" role="alert">
            <div  ng-message="required">You did not enter a field</div>
            <div  ng-message="minlength">Your field is too short</div>
            <div ng-message="maxlength">Your field is too long</div>
        </div>
    </form>
</div>
<script type="text/javascript" src="../../vendor/angular/angular.min.js"></script>
<script type="text/javascript" src="../../vendor/angular/angular-messages.min.js"></script>
<script type="text/javascript" src="app/index.js"></script>
</body>
</html>